/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ejb;

import ejb.facade.CategoriaFacadeLocal;
import ejb.facade.ProdottoFacadeLocal;
import entities.*;
import java.util.*;
import javax.ejb.*;

/**
 *
 * @author sflesca
 */
@Stateless
public class CatalogoManager implements CatalogoManagerLocal {
    @EJB
    private ProdottoFacadeLocal prodottoFacade;
    @EJB
    private CategoriaFacadeLocal categoriaFacade;
    
    

    @Override
    public List<Categoria> getCategorie() {
        return categoriaFacade.findAll();
    }

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

    @Override
    public List<Prodotto> getProdotti(Categoria categoria, int inizio, int numero) {
        
        return prodottoFacade.getProdottiDiCategoria(categoria, inizio, numero);
    }
}
